<?php

namespace App\Providers;

use App\Models\Attendance;
use App\Models\Egress;
use App\Models\Absence;
use App\Models\Transportation;
use App\Models\User;
use App\Transformers\AttendanceTransformer;
use App\Transformers\EgressTransformer;
use App\Transformers\AbsenceTransformer;
use App\Transformers\PersonalTransformer;
use App\Transformers\SummaryTransformer;
use App\Transformers\TransportationTransformer;
use App\Transformers\UserTransformer;
use App\Transformers\ManagementTransformer;
use Illuminate\Support\ServiceProvider;

/**
 * Class TransformerServiceProvider
 * @package App\Providers
 * @SuppressWarnings("CouplingBetweenObjects")
 */
class TransformerServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Register models with transformers
     *
     * @return void
     */
    public function boot()
    {
        /** @var \Dingo\Api\Transformer\Factory $transformer */
        $transformer = app('Dingo\Api\Transformer\Factory');
        $transformer->register(User::class, UserTransformer::class);
        $transformer->register(Transportation::class, TransportationTransformer::class);
        $transformer->register(Egress::class, EgressTransformer::class);
        $transformer->register(Absence::class, AbsenceTransformer::class);
        $transformer->register(Attendance::class, AttendanceTransformer::class);
        $transformer->register(User::class, ManagementTransformer::class);
        $transformer->register(User::class, SummaryTransformer::class);
    }
}
